<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('AdminAd/index')}">网站广告</a></li>
			<li><a href="{:U('AdminAd/add')}">添加广告</a></li>
		</ul>
		<form method="post" class="js-ajax-form">
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('AdminAd/toggle',array('display'=>1))}" data-subcheck="true">显示</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('AdminAd/toggle',array('hide'=>1))}" data-subcheck="true">隐藏</button>
			</div>
			<php> $status=array("1"=>'显示',"0"=>'隐藏'); </php>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">ID</th>
						<th>广告名称</th>
						<th>调用代码</th>
						<th width="45">状态</th>
						<th width="120">操作</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="ads" item="vo">
					<tr>
						<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.ad_id}"></td>
						<td>{$vo.ad_id}</td>
						<td>{$vo.ad_name}</td>
						<php>$usercode="{".":sp_getad('".$vo['ad_name']."')}";</php>
						<td>{$usercode}</td>
						<td>{$status[$vo['status']]}</td>
						<td>
							<a href="{:U('AdminAd/edit',array('id'=>$vo['ad_id']))}">编辑</a> |
							<a href="{:U('AdminAd/delete',array('id'=>$vo['ad_id']))}" class="js-ajax-delete">删除</a>
						</td>
					</tr>
					</foreach>
				</tbody>
				<tfoot>
					<tr>
						<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">ID</th>
						<th>广告名称</th>
						<th>调用代码</th>
						<th width="45">状态</th>
						<th width="120">操作</th>
					</tr>
				</tfoot>
			</table>
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('AdminAd/toggle',array('display'=>1))}" data-subcheck="true">显示</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('AdminAd/toggle',array('hide'=>1))}" data-subcheck="true">隐藏</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>